gusucode.com > 耐品图片管理系统 标准版A > 耐品图片管理系统 标准版A/Function.asp

    <%
Function QuickLaunch()
	QuickLaunch = replace(replace(Netout.CommHtml(1),"{?Height}",90),"{?Title}","栏目速递")
	QuickLaunch = replace(QuickLaunch,"{?Content}",Split(Template.Html(2),"||")(6))
End Function

Function EmptyLine()
	EmptyLine = "<table border=0 cellspacing=0 cellpadding=0><tr><td height=5></td></tr></table>"
End Function

Function ShowLink()
	dim rs,MyHtml,i:i = 1
	Set rs = Netout.Execute("select * from NT_FriendSite where LogoUrl<>'' and LogoUrl<>'http://'")
	Do While Not rs.eof
		MyHtml = MyHtml&"<a href='"&rs("SiteUrl")&"' target='_blank' title='"&rs("SiteName")&"'><img src="&rs("LogoUrl")&" width=88 height=31 border=0></a>"
		If i mod 5=0 Then MyHtml = MyHtml&"<p></p>" Else MyHtml = MyHtml&"&nbsp;&nbsp;&nbsp;&nbsp;"
		rs.MoveNext:i=i+1
	Loop
	Set rs = Nothing
	MyHtml = MyHtml&"<p></p>"
	Set rs = Netout.Execute("select * from NT_FriendSite where LogoUrl='' or LogoUrl='http://'")
	Do While Not rs.eof
		MyHtml = MyHtml&"<a href='"&rs("SiteUrl")&"' target='_blank' title='"&rs("SiteName")&"'>"&rs("SiteName")&"</a>"
		If i mod 5=0 Then MyHtml = MyHtml&"<p></p>" Else MyHtml = MyHtml&"&nbsp;&nbsp;&nbsp;&nbsp;"
		rs.MoveNext:i=i+1
	Loop
	Set rs = Nothing
	ShowLink = MyHtml
End Function

Function ShowContent(MaxPerPage)
	Dim i,j,Html,MyHtml,titleID,titleName,Photoer:i = 0
	Dim iClick,iCount,Hide,HtmlID,Score,Aver,Mark,sRs,mRs,ImageID
	Dim ImageFile,ImageSize,ImagePos,titleCount,rsImage,PicUrl,theSize
	Dim ManuName
	
	MyHtml = vbNewLine&"<script language=javascript>"
	Html = Split(Netout.CommHtml(5),"||")
	If Show = "S" Then HtmlID = 1 Else HtmlID = 3
	IF Config.Settings(8) = "1" Or Person Then TableWidth = 576 Else TableWidth = 740
	IF (Not Search) And Config.Settings(11) = "1" Then
		Html(HtmlID) = Replace(Html(HtmlID),"Image.asp","Search.asp")
		Html(HtmlID) = Replace(Html(HtmlID),"_blank","_parent")
	End IF
	If Not Purchase Is Nothing Then
		MyHtml = MyHtml & Purchase.GetPurchaseScript(0)
	End If
	
	MyHtml = MyHtml&vbNewLine&"function Nt_write_img(titleID,ImageId,titleName,TrueName,ImageUrl,Photoer,iClick,Mark,Score,theSize,CountStr,StrPic1,EditStr,PurchaseLine){"
	MyHtml = MyHtml&vbNewLine&"	var Nt_html = '"&Netout.Js_html(Html(HtmlID))&"';"
	MyHtml = MyHtml&vbNewLine&"	Nt_html=Nt_html.replace(/{\?titleID}/gi,titleID);"
	MyHtml = MyHtml&vbNewLine&"	Nt_html=Nt_html.replace(/{\?(Pos|ImageId)}/gi,ImageId);"
	MyHtml = MyHtml&vbNewLine&"	Nt_html=Nt_html.replace(/{\?Photoer}/gi,Photoer);"
	MyHtml = MyHtml&vbNewLine&"	Nt_html=Nt_html.replace(/{\?iClick}/gi,iClick);"
	MyHtml = MyHtml&vbNewLine&"	Nt_html=Nt_html.replace(/{\?Mark}/gi,Mark);"
	MyHtml = MyHtml&vbNewLine&"	Nt_html=Nt_html.replace(/{\?Score}/gi,Score);"
	MyHtml = MyHtml&vbNewLine&"	Nt_html=Nt_html.replace(/{\?CountStr}/gi,CountStr);"
	MyHtml = MyHtml&vbNewLine&"	Nt_html=Nt_html.replace(/{\?StrPic1}/gi,StrPic1);"
	MyHtml = MyHtml&vbNewLine&"	Nt_html=Nt_html.replace(/{\?TrueName}/gi,TrueName);"
	MyHtml = MyHtml&vbNewLine&"	Nt_html=Nt_html.replace(/{\?titleName}/gi,titleName);"
	MyHtml = MyHtml&vbNewLine&"	Nt_html=Nt_html.replace(/{\?ImageUrl}/gi,ImageUrl);"
	MyHtml = MyHtml&vbNewLine&"	Nt_html=Nt_html.replace(/{\?theSize}/gi,theSize);"
	MyHtml = MyHtml&vbNewLine&"	Nt_html=Nt_html.replace(/{\?EditStr}/gi,EditStr);"
	MyHtml = MyHtml&vbNewLine&"	Nt_html=Nt_html.replace(/{\?PurchaseLine}/gi,PurchaseLine);"
	MyHtml = MyHtml&vbNewLine&"	Nt_html=Nt_html.replace(/{\?Width}/gi,"&(TableWidth\ColSpan)&");"
	MyHtml = MyHtml&vbNewLine&"	document.write(Nt_html);}"
	
	If Not Search Then
		Dim strField
		strField = ""
		If Not Purchase Is Nothing Then
			strField = Purchase.GetFieldName("")
		End If
	End If
	Dim ImagePoint
	ImagePoint = 0

	Set titleID = rs("titleID")
	Set titleName = rs("titleName")
	Set iClick = rs("iClick")
	Set TitleUser = rs("TitleUser")
	Set iCount = rs("iCount")
	Do While Not rs.eof And i<MaxPerPage
		If Show = "S" and i>0 Then
			MyHtml = MyHtml&vbNewLine&"document.write('<tr><td colspan="&ColSpan&" height=6 class=""pic_line""></td></tr>');"
		End If
		MyHtml = MyHtml&vbNewLine&"document.write('<tr class=""tableBack"">');"
		For j=1 to ColSpan
			if rs.eof Then Exit For
			titleCount = ""
			theSize = ""
			If Search Then
				ImageID = rs("ID")
				ImageFile = rs("ImageFile"):ImageSize = Split(rs("ImageSize"),",")
				ImagePos = ImageId
				If Not Purchase Is Nothing Then
					ImagePoint = Purchase.GetFieldValue(Rs)
				End If
			Else
				Set rsImage = Conn.Execute("select top 1 ID,ImageFile,ImageSize"&strField&" from Nt_ImgBook where titleID="&titleID&" and Passed=1"&Netout.GetHideSql("")&" order by UpdateTime Desc,ID desc")
				ImagePos = rsImage(0)
				ImageFile = rsImage(1)
				ImageSize = Split(rsImage(2),",")
				If Not Purchase Is Nothing Then
					ImagePoint = Purchase.GetFieldValue(rsImage)
				End If
				Set rsImage = Nothing
			End If
			If Netout.UserName = Rs("TitleUser")&"" Then ImagePoint = 0
			
			If Config.WaterMark(0) = "1" Then 
				PicUrl=Config.ImagePath(2)&ImageFile
			Else
				theSize = Netout.TrueSize(Cint(ImageSize(0)),Cint(ImageSize(1)),CInt(Config.Settings(5)),CInt(Config.Settings(6)))
				If Config.Settings(18) = "1" Then
					PicUrl = "Show.asp?s=s&f="&ImageFile
				Else
					PicUrl = Config.ImagePath(0)&ImageFile
				End If
			End If
			If Search Then
				Set sRs = Conn.Execute("Select Score,Score/Count From Nt_Score where ImageId="&ImageID)
				If sRs.Eof or sRs.Bof Then
					Score = 0:Aver = 0
				Else
					Score = CLng(sRs(0)):Aver = CInt(sRs(1))
				End If
				Set sRs = Nothing
				IF Score>=CLng(Config.Settings(15)) And Aver>=CInt(Config.Settings(16)) Then StrPic1 = "4" Else StrPic1 = "2"
				Mark = Conn.Execute("select count(*) from Nt_Remark where ImageId="&ImageId)(0)
			Else
				Mark = Conn.Execute("select count(*) from Nt_Remark where titleID="&titleID)(0)
			End If
			if Show = "S" then
				IF Search Then
					CountStr = ""
					TitleCount = 28
				Else
					CountStr = "[<span style=""color:#FF0000"">"&Conn.Execute("Select Count(*) from Nt_ImgBook where TitleId="&titleID&" and Passed=1"&Netout.GetHideSql(""))(0)&"</span>张]"
					TitleCount = 20
				End If
				MyHtml = MyHtml&vbNewLine&"Nt_write_img("&titleID&",'"&ImagePos&"','"&Netout.Js_html(Netout.CutStr(titleName,TitleCount))&"','"&Netout.Js_html(titleName)&"','"&PicUrl&"','"&TitleUser&"','"&iClick&"','"&Mark&"','"&Score&"','"&theSize&"','"&CountStr&"','"&StrPic1&"','"
			Else
				titleCount = "[<span style='color:#FF0000'>"&Conn.Execute("Select Count(*) from Nt_ImgBook where TitleId="&titleID&" and Passed=1"&Netout.GetHideSql(""))(0)&"</span>张]"
				IF Config.WaterMark(0) = "0" Then PicUrl = PicUrl & " width=100"
				MyHtml = MyHtml&vbNewLine&"Nt_write_img("&titleID&",'"&ImagePos&"','"&Netout.Js_html(Netout.CutStr(titleName,24)&titleCount)&"','','"&PicUrl&"','"&TitleUser&"','"&iClick&"','"&Mark&"','"&Score&"/"&Aver&"','"&theSize&"','','','"
			End IF
			IF Netout.Master Then
				MyHtml = MyHtml&"[<a href=""Edit.asp?Action=Edit"
				IF Search Then
					MyHtml = MyHtml&"&ImageId="&ImageId
				Else
					MyHtml = MyHtml&"&TitleId="&TitleId
				End If
				MyHtml = MyHtml&""">编辑</a>][<a href=""Edit.asp?Action=Del&titleID="&titleID
				IF Search Then MyHtml = MyHtml&"&ImageID="&ImageID
				MyHtml = MyHtml&""" onClick=""return confirm(\'确实要删除选中的项目吗?\');"">删除</a>]"
			End IF
			MyHtml = MyHtml&"','"
			If Not Netout.Master Then
				If Not Purchase Is Nothing Then
					MyHtml = MyHtml & Purchase.GetPurchaseLine(ImagePos,ImagePoint,0,0,Netout.DataExists("Select ListId from Nt_Basket Where UserId="&Netout.UserId&" and ImageId="&ImagePos))
				End If
			End If
			MyHtml = MyHtml&"');"
			rs.movenext:i = i+1
		Next
		MyHtml = MyHtml&vbNewLine&"document.write('</tr>');"
	Loop
	MyHtml = MyHtml&vbNewLine&"</script>"
	IF Config.Settings(8) = "1" Or Person Then
		ShowContent = Replace(Replace(Html(HtmlID-1),"740","576"),"{?Record}",MyHtml)
	Else
		ShowContent = Replace(Replace(Html(HtmlID-1),"97%","710"),"{?Record}",MyHtml)
		ShowContent = Replace(ShowContent,"576","740")
	End IF
End Function

Public Function Createpass()
	Dim Ran,i,LengthNum
	LengthNum=16
	Createpass=""
	For i=1 To LengthNum
		Randomize
		Ran = CInt(Rnd * 2)
		Randomize
		If Ran = 0 Then
			Ran = CInt(Rnd * 25) + 97
			Createpass =Createpass& UCase(Chr(Ran))
		ElseIf Ran = 1 Then
			Ran = CInt(Rnd * 9)
			Createpass = Createpass & Ran
		ElseIf Ran = 2 Then
			Ran = CInt(Rnd * 25) + 97
			Createpass =Createpass& Chr(Ran)
		End If
	Next
End Function
%>